package com.ruoyi.repay.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.repay.domain.RepaymentPlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RepaymentPlanMapper {
//    @Select("select * from repayment_plan where user_info_code=#{userInfoCode} and is_deleted=0")
//    @Select("select * from repayment_plan where is_deleted=0 and types = 0 and code=#{code}")
//    List<RepaymentPlan> repayList(String userInfoCode);
@Select("select * from repayment_plan where id=#{id} and is_deleted=0")
    RepaymentPlan selectById(Integer id);
@Update("update repayment_plan set out_trade_no=#{outTradeNo} where id=#{id} and is_deleted=0")
    void updateById(RepaymentPlan repaymentPlan);
@Update("update repayment_plan set types=#{type} where out_trade_no=#{outNo} and is_deleted=0")
    void update(@Param("outNo") String outTradeNo,@Param("type") Integer types);
@Select("select * from repayment_plan where is_deleted=0 and types = 1")
    List<RepaymentPlan> repayList2();
@Select("select * from repayment_plan where out_trade_no=#{outTradeNo} and is_deleted=0")
    RepaymentPlan select(String outTradeNo);
@Update("update repayment_plan set update_time=#{updateTime} where out_trade_no=#{outTradeNo} and is_deleted=0")
    void updates(RepaymentPlan repaymentPlan);
}
